package com.rocsun.order.controller;

import com.rocsun.order.Order;
import com.rocsun.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: rocsun-cloud-alibaba
 * @description:
 * @author: yx.guo
 * @create: 2025-08-28 10:45
 **/
@RestController
public class OrderController {

    @Autowired
    OrderService orderService;

    @GetMapping("/order/create")
    public Order getOrder(@RequestParam(value = "userId") Long userId,
                          @RequestParam(value = "productId") Long productId) {
        Order order = orderService.createOrder(productId, userId);
        return order;
    }

}
